Optimal. Leaf size=134 \[ -\frac{3 d^2 (c+d x) \sin (a+b x) \cos (a+b x)}{4 b^3}+\frac{3 d (c+d x)^2 \cos ^2(a+b x)}{4 b^2}-\frac{3 d^3 \cos ^2(a+b x)}{8 b^4}+\frac{(c+d x)^3 \sin (a+b x) \cos (a+b x)}{2 b}-\frac{3 c d^2 x}{4 b^2}-\frac{3 d^3 x^2}{8 b^2}+\frac{(c+d x)^4}{8 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.073885, antiderivative size = 134, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.188, Rules used = {3311, 32, 3310} \[ -\frac{3 d^2 (c+d x) \sin (a+b x) \cos (a+b x)}{4 b^3}+\frac{3 d (c+d x)^2 \cos ^2(a+b x)}{4 b^2}-\frac{3 d^3 \cos ^2(a+b x)}{8 b^4}+\frac{(c+d x)^3 \sin (a+b x) \cos (a+b x)}{2 b}-\frac{3 c d^2 x}{4 b^2}-\frac{3 d^3 x^2}{8 b^2}+\frac{(c+d x)^4}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3311
Rule 32
Rule 3310
Rubi steps
\begin{align*} \int (c+d x)^3 \cos ^2(a+b x) \, dx &=\frac{3 d (c+d x)^2 \cos ^2(a+b x)}{4 b^2}+\frac{(c+d x)^3 \cos (a+b x) \sin (a+b x)}{2 b}+\frac{1}{2} \int (c+d x)^3 \, dx-\frac{\left (3 d^2\right ) \int (c+d x) \cos ^2(a+b x) \, dx}{2 b^2}\\ &=\frac{(c+d x)^4}{8 d}-\frac{3 d^3 \cos ^2(a+b x)}{8 b^4}+\frac{3 d (c+d x)^2 \cos ^2(a+b x)}{4 b^2}-\frac{3 d^2 (c+d x) \cos (a+b x) \sin (a+b x)}{4 b^3}+\frac{(c+d x)^3 \cos (a+b x) \sin (a+b x)}{2 b}-\frac{\left (3 d^2\right ) \int (c+d x) \, dx}{4 b^2}\\ &=-\frac{3 c d^2 x}{4 b^2}-\frac{3 d^3 x^2}{8 b^2}+\frac{(c+d x)^4}{8 d}-\frac{3 d^3 \cos ^2(a+b x)}{8 b^4}+\frac{3 d (c+d x)^2 \cos ^2(a+b x)}{4 b^2}-\frac{3 d^2 (c+d x) \cos (a+b x) \sin (a+b x)}{4 b^3}+\frac{(c+d x)^3 \cos (a+b x) \sin (a+b x)}{2 b}\\ \end{align*}
Mathematica [A] time = 0.450567, size = 106, normalized size = 0.79 \[ \frac{2 b (c+d x) \sin (2 (a+b x)) \left (2 b^2 (c+d x)^2-3 d^2\right )+3 d \cos (2 (a+b x)) \left (2 b^2 (c+d x)^2-d^2\right )+2 b^4 x \left (6 c^2 d x+4 c^3+4 c d^2 x^2+d^3 x^3\right )}{16 b^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.027, size = 587, normalized size = 4.4 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.11375, size = 578, normalized size = 4.31 \begin{align*} \frac{4 \,{\left (2 \, b x + 2 \, a + \sin \left (2 \, b x + 2 \, a\right )\right )} c^{3} - \frac{12 \,{\left (2 \, b x + 2 \, a + \sin \left (2 \, b x + 2 \, a\right )\right )} a c^{2} d}{b} + \frac{12 \,{\left (2 \, b x + 2 \, a + \sin \left (2 \, b x + 2 \, a\right )\right )} a^{2} c d^{2}}{b^{2}} - \frac{4 \,{\left (2 \, b x + 2 \, a + \sin \left (2 \, b x + 2 \, a\right )\right )} a^{3} d^{3}}{b^{3}} + \frac{6 \,{\left (2 \,{\left (b x + a\right )}^{2} + 2 \,{\left (b x + a\right )} \sin \left (2 \, b x + 2 \, a\right ) + \cos \left (2 \, b x + 2 \, a\right )\right )} c^{2} d}{b} - \frac{12 \,{\left (2 \,{\left (b x + a\right )}^{2} + 2 \,{\left (b x + a\right )} \sin \left (2 \, b x + 2 \, a\right ) + \cos \left (2 \, b x + 2 \, a\right )\right )} a c d^{2}}{b^{2}} + \frac{6 \,{\left (2 \,{\left (b x + a\right )}^{2} + 2 \,{\left (b x + a\right )} \sin \left (2 \, b x + 2 \, a\right ) + \cos \left (2 \, b x + 2 \, a\right )\right )} a^{2} d^{3}}{b^{3}} + \frac{2 \,{\left (4 \,{\left (b x + a\right )}^{3} + 6 \,{\left (b x + a\right )} \cos \left (2 \, b x + 2 \, a\right ) + 3 \,{\left (2 \,{\left (b x + a\right )}^{2} - 1\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} c d^{2}}{b^{2}} - \frac{2 \,{\left (4 \,{\left (b x + a\right )}^{3} + 6 \,{\left (b x + a\right )} \cos \left (2 \, b x + 2 \, a\right ) + 3 \,{\left (2 \,{\left (b x + a\right )}^{2} - 1\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} a d^{3}}{b^{3}} + \frac{{\left (2 \,{\left (b x + a\right )}^{4} + 3 \,{\left (2 \,{\left (b x + a\right )}^{2} - 1\right )} \cos \left (2 \, b x + 2 \, a\right ) + 2 \,{\left (2 \,{\left (b x + a\right )}^{3} - 3 \, b x - 3 \, a\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} d^{3}}{b^{3}}}{16 \, b} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.15807, size = 394, normalized size = 2.94 \begin{align*} \frac{b^{4} d^{3} x^{4} + 4 \, b^{4} c d^{2} x^{3} + 3 \,{\left (2 \, b^{4} c^{2} d - b^{2} d^{3}\right )} x^{2} + 3 \,{\left (2 \, b^{2} d^{3} x^{2} + 4 \, b^{2} c d^{2} x + 2 \, b^{2} c^{2} d - d^{3}\right )} \cos \left (b x + a\right )^{2} + 2 \,{\left (2 \, b^{3} d^{3} x^{3} + 6 \, b^{3} c d^{2} x^{2} + 2 \, b^{3} c^{3} - 3 \, b c d^{2} + 3 \,{\left (2 \, b^{3} c^{2} d - b d^{3}\right )} x\right )} \cos \left (b x + a\right ) \sin \left (b x + a\right ) + 2 \,{\left (2 \, b^{4} c^{3} - 3 \, b^{2} c d^{2}\right )} x}{8 \, b^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 3.2626, size = 456, normalized size = 3.4 \begin{align*} \begin{cases} \frac{c^{3} x \sin ^{2}{\left (a + b x \right )}}{2} + \frac{c^{3} x \cos ^{2}{\left (a + b x \right )}}{2} + \frac{3 c^{2} d x^{2} \sin ^{2}{\left (a + b x \right )}}{4} + \frac{3 c^{2} d x^{2} \cos ^{2}{\left (a + b x \right )}}{4} + \frac{c d^{2} x^{3} \sin ^{2}{\left (a + b x \right )}}{2} + \frac{c d^{2} x^{3} \cos ^{2}{\left (a + b x \right )}}{2} + \frac{d^{3} x^{4} \sin ^{2}{\left (a + b x \right )}}{8} + \frac{d^{3} x^{4} \cos ^{2}{\left (a + b x \right )}}{8} + \frac{c^{3} \sin{\left (a + b x \right )} \cos{\left (a + b x \right )}}{2 b} + \frac{3 c^{2} d x \sin{\left (a + b x \right )} \cos{\left (a + b x \right )}}{2 b} + \frac{3 c d^{2} x^{2} \sin{\left (a + b x \right )} \cos{\left (a + b x \right )}}{2 b} + \frac{d^{3} x^{3} \sin{\left (a + b x \right )} \cos{\left (a + b x \right )}}{2 b} + \frac{3 c^{2} d \cos ^{2}{\left (a + b x \right )}}{4 b^{2}} - \frac{3 c d^{2} x \sin ^{2}{\left (a + b x \right )}}{4 b^{2}} + \frac{3 c d^{2} x \cos ^{2}{\left (a + b x \right )}}{4 b^{2}} - \frac{3 d^{3} x^{2} \sin ^{2}{\left (a + b x \right )}}{8 b^{2}} + \frac{3 d^{3} x^{2} \cos ^{2}{\left (a + b x \right )}}{8 b^{2}} - \frac{3 c d^{2} \sin{\left (a + b x \right )} \cos{\left (a + b x \right )}}{4 b^{3}} - \frac{3 d^{3} x \sin{\left (a + b x \right )} \cos{\left (a + b x \right )}}{4 b^{3}} - \frac{3 d^{3} \cos ^{2}{\left (a + b x \right )}}{8 b^{4}} & \text{for}\: b \neq 0 \\\left (c^{3} x + \frac{3 c^{2} d x^{2}}{2} + c d^{2} x^{3} + \frac{d^{3} x^{4}}{4}\right ) \cos ^{2}{\left (a \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.1253, size = 207, normalized size = 1.54 \begin{align*} \frac{1}{8} \, d^{3} x^{4} + \frac{1}{2} \, c d^{2} x^{3} + \frac{3}{4} \, c^{2} d x^{2} + \frac{1}{2} \, c^{3} x + \frac{3 \,{\left (2 \, b^{2} d^{3} x^{2} + 4 \, b^{2} c d^{2} x + 2 \, b^{2} c^{2} d - d^{3}\right )} \cos \left (2 \, b x + 2 \, a\right )}{16 \, b^{4}} + \frac{{\left (2 \, b^{3} d^{3} x^{3} + 6 \, b^{3} c d^{2} x^{2} + 6 \, b^{3} c^{2} d x + 2 \, b^{3} c^{3} - 3 \, b d^{3} x - 3 \, b c d^{2}\right )} \sin \left (2 \, b x + 2 \, a\right )}{8 \, b^{4}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]